import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    currentAdmin: {},
    routeList: []
  },
  mutations: {
    currentAdmin(state, user) {
      state.currentAdmin = user;
    },
    customAddRoute(state, list) {
      state.routeList = list
    }
  },
  actions: {
    pushRoute({commit}, list) {
      commit('customAddRoute', list)
    }
  },
  modules: {},
  plugins: []
})
